package service;

import org.aspectj.lang.ProceedingJoinPoint;

import java.util.Arrays;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class LogLanjie {
    public Object doLanjie(ProceedingJoinPoint jp) throws Throwable {
        //
        long start=System.nanoTime();
        System.out.println("方法："+jp.getTarget()+"."+jp.getSignature().getName()+"在什么时刻执行？"+new Date());
        System.out.println("参数："+ Arrays.toString(jp.getArgs()));
        Object result = jp.proceed();
        long end=System.nanoTime();
        System.out.println(jp.getSignature().getName()+" 返回了："+result+":"+"耗时"+(end-start)+"纳秒");
        return result;
    }
}
